package com.bestv.engine.model.content.impl;

import com.bestv.database.dao.DaoFactory;
import com.bestv.database.vo.Series;
import com.bestv.engine.model.RecommendationModel;
import com.bestv.lucene.ProgramSearcher;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Henry on 14-6-11.
 */
public class ContentSimilarModel extends RecommendationModel {

    @Override
    protected List<Object> getItemRelations(long itemId, int typeId, int maxCount) {
        ProgramSearcher searcher = new ProgramSearcher();
        Series series = DaoFactory.getSeriesDao().findById(itemId);
        if (series == null) return new ArrayList<Object>();
        return searcher.search(series.getName(), maxCount);
    }
}
